Currently, cloud computing has been applied more widely, and a file can be saved and backed up for a user based on an existing cloud server. More users are also willing to upload their files to a cloud server for saving, to reduce a storage cost.
A cloud server not only can save a file for a user, but also can share, with another user, a file saved by a user.
A method for sharing a file on a cloud server is as follows: A user A compresses 1000 files into a file package and encrypts the file package, and uploads the encrypted file package to the cloud server for saving. If the user A intends to share 100 files in the 1000 files with a user B, the user A first retrieves the encrypted file package from the cloud server and decrypts the encrypted file package to acquire the 1000 files in the encrypted file package; then, among the 1000 files, the user A compresses the 100 files to be shared into a file package and encrypts the file package, compresses other 900 files into another file package and encrypts the file package, and uploads the two encrypted file packages to the cloud server for saving; and finally, the user A notifies the user B of a key of the encrypted file package in which the 100 files to be shared are located and a uniform resource locator (URL) used by the cloud server to save the encrypted file package. The user B can acquire, from the cloud server by using the URL, the encrypted file package in which the 100 files are located, and use the key that is notified by the user A to decrypt the encrypted file package, so as to acquire the 100 files in the encrypted file package.
As can be seen, in the method for sharing a file on a cloud server, files that have been already saved on the cloud server need to be changed; moreover, if the user A also intends to share other files with a user C, the user A needs to retrieve again the file package corresponding to the 900 files and the file package corresponding to the 100 files, where the file package corresponding to the 900 files and the file package corresponding to the 100 files have been already uploaded to the cloud server, separately decrypts the file packages to acquire the total of 1000 files in the two file packages, and then shares files with the user C by using a method similar to that used to share the files with the user B. This process is cumbersome and inefficient.